<?xml version="1.0" encoding="ISO-8859-1" ?>

<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<%@include file="../../context.jsp"%>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Weekly Share Data List</title>
<%@include file="../common_Admin_imports.jsp"%>
<%@include file="../common_list_page.jsp"%>

<script type="text/javascript">
	$(document)
			.ready(
					function() {
						resetSelectAll();
						$('#selectAll').on('click', function() {
							selectAll();
						});
						paginationNextBtn("${pageContext.request.contextPath}/admin/weeklysharedata/list.html?totalRecords=${weeklySharePage.totalNoOfRecords}&page=");
					});

	function deleteFiltered() {
		var proceed = confirm("Are you sure, you want to delete the searched dataset ? If you select yes, the operation cannot be undone");
		if (proceed) {
			var baseUrl = "${pageContext.request.contextPath}/admin/weeklysharedata/deleteFiltered.html";
			document.location = baseUrl;
		}

		return proceed;
	}
</script>
<style type="text/css">
.datepicker,.searchSelector {
	margin-right: 10px;
	width: 100px;
}

.searchSelector {
	margin-right: 10px;
	width: 150px;
}

.btnSerch {
	padding: 4px;
}
</style>
</head>
<body>
	<div class="main_wrapper">
		<div class="header_wrapper">
			<div class="container-fluid">
				<div class="header_inner_wrapper clearfix">
					<div class="row-fluid">
						<div class="header_left span4">List of Weekly Share Data</div>
						<div class="header_right span8">
							<!-- search section -->
							<jsp:include page="../search.jsp">
								<jsp:param name="page" value="weeklysharedata" />
							</jsp:include>
							<!-- end of search section -->
						</div>
					</div>
				</div>
			</div>

			<div class="row-fluid">
				<div class="main_table">
					<form:form method="POST"
						action="${pageContext.request.contextPath}/admin/weeklysharedata/delete/selected.html">
						<table class="table table-bordered table-striped">
							<thead>
								<tr>
									<th id="tableHeader"><input type="checkbox" id="selectAll"
										name="deleteHeader" /></th>
									<th id="tableHeader">No</th>
									<th id="tableHeader">Company Name</th>
									<th id="tableHeader">Date</th>
									<th id="tableHeader">Share Price</th>
									<th id="tableHeader">high</th>
									<th id="tableHeader">low</th>
									<th id="tableHeader">turnOver</th>
									<th id="tableHeader">volume</th>
									<th id="tableHeader">no Of Trade</th>
									<th id="tableHeader">Opening Price</th>
									<th></th>
									<th></th>
								</tr>
							</thead>
							<tbody>
								<c:forEach var="weeklyShareData"
									items="${weeklySharePage.pageData}">
									<tr>
										<td><input type="checkbox" class="selectedId"
											name="deleteIds" value="${weeklyShareData.id}" /></td>
										<td>${weeklyShareData.id}</td>
										<td>${weeklyShareData.company.name}</td>
										<td id="dateAlign"><fmt:formatDate
												pattern="${dateFormat}" value="${weeklyShareData.date}" /></td>
										<td id="numberAlign"><fmt:formatNumber
												maxFractionDigits="${MaxFraction}"
												minFractionDigits="${MinFraction}"
												value="${weeklyShareData.sharePrice}" /></td>
										<td id="numberAlign"><fmt:formatNumber
												maxFractionDigits="${MaxFraction}"
												minFractionDigits="${MinFraction}"
												value="${weeklyShareData.high}" /></td>
										<td id="numberAlign"><fmt:formatNumber
												maxFractionDigits="${MaxFraction}"
												minFractionDigits="${MinFraction}"
												value="${weeklyShareData.low}" /></td>
										<td id="numberAlign"><fmt:formatNumber
												maxFractionDigits="${MaxFraction}"
												minFractionDigits="${MinFraction}"
												value="${weeklyShareData.turnOver}" /></td>
										<td id="numberAlign"><fmt:formatNumber
												maxFractionDigits="${MaxFraction}"
												minFractionDigits="${MinFraction}"
												value="${weeklyShareData.volume}" /></td>
										<td id="numberAlign"><fmt:formatNumber
												maxFractionDigits="${MaxFraction}"
												minFractionDigits="${MinFraction}"
												value="${weeklyShareData.noOfTrade}" /></td>
										<td id="numberAlign"><fmt:formatNumber
												maxFractionDigits="${MaxFraction}"
												minFractionDigits="${MinFraction}"
												value="${weeklyShareData.openingPrice}" /></td>
										<td><div class="btn btn-info">
												<a
													href="${pageContext.request.contextPath}/admin/weeklysharedata/edit/${weeklyShareData.id}.html">Edit</a>
											</div></td>
										<td><div class="btn btn-danger">
												<a
													lang="${pageContext.request.contextPath}/admin/weeklysharedata/delete/${weeklyShareData.id}.html"
													href="javascript:void(0);"
													onclick="return confirmAndDelete(this);">Delete</a>
											</div></td>
									</tr>
								</c:forEach>
							</tbody>
						</table>
						<div>
							<div>
								<input
									onclick="return confirm('Are you sure, you want to delete all the selected results. This opperation cannot be undone');"
									class="btn btn-danger" type="submit" value="Delete Selected" />
								<input onclick="return deleteFiltered();" class="btn btn-danger"
									type="button" value="Delete Filtered List" />
							</div>
						</div>
					</form:form>
					<!-- paging section -->
					<div class="pagination pagination-right">
						<!-- page number -->
						Page&nbsp;<input value="${weeklySharePage.currentPageNo}"
							style="width: 50px;" type="number" min="0"
							max="${weeklySharePage.totalNoOfPages }" id="pageNum"> <!-- end page number -->
							<ul>
								<li><c:if test="${weeklySharePage.showPrev}">
										<a
											href="${pageContext.request.contextPath}/admin/weeklysharedata/list.html?page=${weeklySharePage.currentPageNo-1}&totalRecords=${weeklySharePage.totalNoOfRecords}">Prev</a>
									</c:if></li>
								<c:forEach begin="${weeklySharePage.startPageNo}" var="page"
									end="${weeklySharePage.endPageNo}">
									<li><a
										<c:if test="${weeklySharePage.currentPageNo==page}">style="background-color:#79BAEC"</c:if>
										href="${pageContext.request.contextPath}/admin/weeklysharedata/list.html?page=${page}&totalRecords=${weeklySharePage.totalNoOfRecords}">${page}</a></li>&nbsp;
							</c:forEach>
								<li><c:if test="${weeklySharePage.showNext}">
										<a
											href="${pageContext.request.contextPath}/admin/weeklysharedata/list.html?page=${weeklySharePage.currentPageNo+1}&totalRecords=${weeklySharePage.totalNoOfRecords}">Next</a>
									</c:if></li>
								<li><a class="pageCountLink">${weeklySharePage.totalNoOfPages }
										Pages</a></li>
							</ul>
					</div>
					<div>
						<br></br>
					</div>
					<!-- paging section -->
					<div class="btn btn-success">
						<a
							href="${pageContext.request.contextPath}/admin/weeklysharedata/add.html">New</a>
					</div>
				</div>
			</div>
		</div>
	</div>
	</div>
</body>
</html>